<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<a href="javascript:toPage(3)">首页</a>
<a href="javascript:toPage(1)">上一页</a>
<a href="javascript:toPage(2)">下一页</a>
<a href="javascript:toPage(4)">尾页</a>
当前第<input type="text" id="pageNumber" name="pageNum" size="1">页
每页<input type="text" id="pageSize" name="pageSize" size="1">条
共<input type="text" id="totalPage" readonly="readonly" size="1">页
共<input type="text" id="totalCount" readonly="readonly" size="1">条

<script type="text/javascript">
function toPage(flag){
	var pageNumber = parseInt($("#pageNumber").val());
	var totalPage = parseInt($("#totalPage").val());
	if(flag == 1){
		if(pageNumber <= 1){
			toastr.error("已经是首页");
			return;
		}
		$("#pageNumber").val(pageNumber - 1);
	}else if(flag == 2){
		if(pageNumber >= totalPage){
			toastr.success("已经是尾页");
			return;
		}
		$("#pageNumber").val(pageNumber + 1);
	}else if(flag == 3){
		if(pageNumber <= 1){
			toastr.warning("已经是首页");
			return;
		}
		$("#pageNumber").val(1);
	}else if(flag == 4){
		if(pageNumber >= totalPage){
			toastr.info("已经是尾页");
			return;
		}
		$("#pageNumber").val(totalPage);
	}
	getData();
}

function pageInstall(page){
	//获取页面文本框并赋值 (当前页数)
	$("#pageNumber").val(page.pageNum);
	$("#pageSize").val(page.pageSize);
	$("#totalPage").val(page.lastPage);
	$("#totalCount").val(page.total);
}
</script>
